package org.pageley.games.sanctuary;

import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.core.io.Resource;

public class ResourceUriFactoryBean extends AbstractFactoryBean {

    private Resource resource;

    public ResourceUriFactoryBean(Resource resource) {
        this.resource = resource;
    }

    @Override
    protected String createInstance() throws Exception {
        return resource.getURI().toString();
    }

    @Override
    public Class<? extends String> getObjectType() {
        return String.class;
    }    
}
